﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

using HGZP.BLL;
using HGZP.Model;
using HGZP.PLL;

namespace SZCB.admin
{
    public partial class commoditymanager : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitList();
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
        }

        protected void InitList()
        {
/*            CLargeClassBLL myCLargeClassBLL = new CLargeClassBLL();
            DropDownList1.DataSource = myCLargeClassBLL.F02_SelectHaveWhere(string.Empty);
            DropDownList1.DataTextField = "sName";
            DropDownList1.DataValueField = "sGuid";
            DropDownList1.DataBind();

            DropDownList2.DataSource = myCLargeClassBLL.F02_SelectHaveWhere(string.Empty);
            DropDownList2.DataTextField = "sName";
            DropDownList2.DataValueField = "sGuid";
            DropDownList2.DataBind();

            CKindClassBLL myCKindClassBLL = new CKindClassBLL();

            DropDownList3.DataSource = myCKindClassBLL.F02_SelectHaveWhere(string.Empty);
            DropDownList3.DataTextField = "sName";
            DropDownList3.DataValueField = "sGuid";
            DropDownList3.DataBind();*/

        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            /*CKindClassBLL myCKindClassBLL = new CKindClassBLL();
            DataTable dt = myCKindClassBLL.F02_SelectHaveWhere("sName='" + TextBox3.Text + "'");
            if (dt.Rows.Count > 0)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "温馨提示", "<script language='javascript'>alert('该记录已经存在！');history.back();'</script>");
                return;
            }
            CKindClass myCKindClass = new CKindClass();
            myCKindClass.sGuid = MyFunction.GetNewGuid();
            myCKindClass.CreateDate = DateTime.Now;
            myCKindClass.sName = TextBox3.Text;
            myCKindClass.sCode = TextBox4.Text;
            myCKindClass.sLargeClassGuid = DropDownList1.SelectedItem.Value;
            myCKindClassBLL.F_Insert(myCKindClass);*/
        }

        protected void Button3_Click(object sender, EventArgs e)
        {
            /*CSmallClassBLL myCSmallClassBLL = new CSmallClassBLL();
            DataTable dt = myCSmallClassBLL.F02_SelectHaveWhere("sName='" + TextBox6.Text + "'");
            if (dt.Rows.Count > 0)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "温馨提示", "<script language='javascript'>alert('该记录已经存在！');history.back();'</script>");
                return;
            }

            CSmallClass myCSmallClass = new CSmallClass();
            myCSmallClass.sName = TextBox6.Text;
            myCSmallClass.sGuid = MyFunction.GetNewGuid();
            myCSmallClass.CreateDate = DateTime.Now;
            myCSmallClass.sCode = TextBox5.Text;
            myCSmallClass.sKindClassGuid = DropDownList3.SelectedItem.Value;
            myCSmallClass.sLargeClassGuid = DropDownList2.SelectedItem.Value;
            myCSmallClassBLL.F_Insert(myCSmallClass);*/
        }

    }
}